Skip to content

Instantly share code, notes, and snippets.

import { Client } from "@upstash/qstash"
import { NextRequest } from "next/server"
const baseUrl = process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`
: "http://localhost:3000"
interface Step<I> {
create: <O>(action: (prevResult: Awaited<I>) => O) => Step<O>
finally: (action: (prevResult: Awaited<I>) => any) => any
import { Client } from "@upstash/qstash"
import { NextRequest } from "next/server"
const baseUrl = process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`
: "http://localhost:3000"
interface Step<I> {
create: <O>(action: (prevResult: Awaited<I>) => O) => Step<O>
finally: (action: (prevResult: Awaited<I>) => any) => any
@sametcn99
sametcn99 / README.md
Last active May 17, 2024 19:19
Glob patterns are a powerful mechanism for matching file and directory names in a file system.

Using Glob Patterns in TypeScript Projects: A Comprehensive Guide with Detailed Character Explanations and Examples

Introduction to Glob Patterns in TypeScript

Glob patterns are a powerful mechanism for matching file and directory names in a file system. In TypeScript projects, they play a crucial role in tasks such as file selection, automation, and maintaining a modular project structure. To harness the full power of glob patterns, it's essential to understand each character and its role in defining matching criteria. Let's dive into a detailed exploration of glob pattern characters:

* (Asterisk)

  • Usage: Represents any sequence of characters.
@lpenz
lpenz / custom.toml
Created August 27, 2023 13:09
custom.toml example for Raspberry Pi OS
# Raspberry PI OS config.toml
# This file is used for the initial setup of the system on the first boot, if
# it's s present in the boot partition of the installation.
#
# This file is loaded by firstboot, parsed by init_config and ends up
# as several calls to imager_custom.
# The example below has all current fields.
#
# References:
# - https://github.com/RPi-Distro/raspberrypi-sys-mods/blob/master/usr/lib/raspberrypi-sys-mods/firstboot
@robertkirkman
robertkirkman / README.md
Last active May 17, 2024 19:19
How to record or stream SteamOS 3.X Gaming Mode

How to record or stream SteamOS 3.X in gamescope (Gaming Mode)

Here is another method that uses Flatpak and obs-vkcapture, which don't meet my personal needs but are very likely to be useful for you. In the comments there there is also an obs-gstreamer method.

Here is another method for recording that has its own GUI for Gaming Mode built with Decky Loader.

Force SteamOS to behave very much like Arch Linux

Key phrase: very much like, not identical. Always treat this as more unstable than Manjaro and only expect support with it in my comments section here.

  1. Set a password (if you haven't already) and disable read-only rootfs (yes this means after updating SteamOS [not Steam Client] this will all be deleted and you will have to do all this again if you want
@dansutherland-engineer
dansutherland-engineer / cookie-banner.liquid
Last active May 17, 2024 19:15
Shopify basic cookie consent banner using the Customer Privacy API
@armornick
armornick / openicon.c
Created August 23, 2012 08:47
Draw an Image with SDL2
#include <stdio.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#define WIDTH 800
#define HEIGHT 600
#define IMG_PATH "exit.png"
int main (int argc, char *argv[]) {
@swankjesse
swankjesse / HostSelectionInterceptor.java
Last active May 17, 2024 19:11
This OkHttp application interceptor will replace the destination hostname in the request URL.
import java.io.IOException;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
/** An interceptor that allows runtime changes to the URL hostname. */
public final class HostSelectionInterceptor implements Interceptor {
private volatile String host;
@veekaybee
veekaybee / normcore-llm.md
Last active May 17, 2024 19:10
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@Moukrea
Moukrea / creer-un-serveur-docker-sur-votre-freebox-delta.md
Created January 16, 2022 15:34
Créer un server utilisant Docker sur votre Freebox Delta

Créer un server utilisant Docker sur votre Freebox Delta

Ceci est un guide étape par étape pour créer un serveur utilisant Docker facilement sur votre Freebox Delta

Pré-requis

Vous avez déjà accédé à Freebox OS et ce dernier est déjà configuré pour la connexion. Cliquez ici pour configurer votre Freebox si ce n'est pas déjà fait.

Vous avez un disque dur connecté sur votre Freebox (nécessaire pour installer une machine virtuelle). Ci ce n'est pas déjà fait, vous pouvez suivre un des guides ci-dessous: